#include<iostream>
using namespace std;
const int N = 1e3 + 10;
int arr[N][N];
int sum[N][N];
int d[N][N];
int n, m;
int main()
{
	cin >> n >> m;
	while (m--) {
		int x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;
		d[x1][y1]++;
		d[x1][y2 + 1]--;
		d[x2+1][y1]--;
		d[x2 + 1][y2 + 1]++;
	}
	for (int i = 1; i < n + 1; i++) {
		for (int j = 1; j < n + 1; j++) {
			sum[i][j] += d[i][j] + sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1];
		}
	 }
	for (int i = 1; i < n + 1; i++) {
		for (int j = 1; j < n + 1; j++) {
			arr[i][j] += sum[i][j];
		}
	}   
	for (int i = 1; i < n + 1; i++) {
		for (int j = 1; j < n + 1; j++) {
			cout << arr[i][j] << " ";
		}
		cout << endl;
	}
	return 0;
}